<?php
namespace Database;

class ResourceCategory extends Base
{

    public function __construct()
    {
        $this->setModel(MODEL_RESOURCECATEGORY);
    }

    public function getLastGradeList()
    {
        $sql = $this->getSql();
        $sql->field('*');
        $sql->table($this->getTable());
        $sql->where('dry_status', '=', 1);
        $sql->andWhere('dry_grade', '=', 3);
        $sql->setOrder('dry_data_sort', 'asc');
        $sql->setPage(1);
        $sql->setPageSize(100);
        $sql->setLimit();
        $list = $this->fetchAll($sql->get());
        $count = $this->fetchColumn($sql->getTotalSql());
        return [
            'list' => $list,
            'count' => $count
        ];
    }

}